#include "example_filter.h"
#include "vulkan_helpers.hpp"
using namespace vuh;
auto main(int argc, char* argv[])-> int {
	const auto width = 10;
	const auto height = 5;
	const auto a = 2.0f; // saxpy scaling factor
	
	auto y = std::vector<float>(width*height, 0.0f);
	auto x = std::vector<float>(width*height, 2.0f);
	auto z = std::vector<float>(width*height, 1.0f);

	ExampleFilter f("shaders/saxpy.spv");
	auto d_y = Array<float>::fromHost(y, f.device, f.physDevice);
	auto d_x = Array<float>::fromHost(x, f.device, f.physDevice);
	auto d_z = Array<float>::fromHost(z, f.device, f.physDevice);

	f(d_y,d_z, d_x, {width, height, a});

	auto out_tst = std::vector<float>{};
	d_y.to_host(out_tst); // and now out_tst should contain the result of saxpy (y = z + x)
	for(int i =0;i<out_tst.size();i++){
		printf("id %d  = %f \n",i,out_tst[i]);
	}
   
   return 0;
}
